//管理员相关请求
import httpInstance from "@/utils/http";

// 用户密码登录
export async function passwordLoginAPI({ account, password }) {
  try {
    const res = await httpInstance.request({
      url: '/api/admin/login',
      method: 'POST',
      data: {
        account,
        password
      }
    })
    return res
  } catch (error) {
    throw error;
  }
}


// 登出
export async function logoutAPI() {
  try {
    const res = await httpInstance.request({
      url: '/api/addmin/logout',
      method: 'POST',

      headers: {
        'Authorization': localStorage.getItem('token')
      }
    })
    return res.data
  } catch (error) {
    throw error;
  }
}

